home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1991-1995 by TopSoft Inc. All rights reserved.
-
- You may distribute this file under the terms of the TopSoft
- Artistic License, accompanying this package.
-
- This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
- See the Modification History for more details.
-
- Product
- About Box
-
- FILE
- ABObject.h
-
- NAME
- ABObject.h, part of the ABox project source code,
- responsible for handling the AboutBox resource (element) class stuff.
-
- DESCRIPTION
- This file contains defines for the about box modules.
-
- DEVELOPED BY
- George (ty) Tempel netromancr@aol.com
- All code in this file, and its associated header file was
- Created by George (ty) Tempel in connection with the TopSoft, Inc.
- "FilterTop" application development, except where noted.
-
- CARETAKER - George (ty) Tempel <netromancr@aol.com>
- Please consult this person for any changes or suggestions to this file.
-
- MODIFICATION HISTORY
-
- dd mmm yy - xxx - patchxx: description of patch
- 9 June 94 - ty - Initial Version Created
- 20-july-94 - ty - initial version released
- 12-aug-94 - ty - added mix in class ABUEnvQD for quickdraw
- feature handling
- 10-mar-95 - ty - 1.2 removed utility methods from here to ABUEnvQD
- since they were quickdraw related; inclusion of some
- new methods for handling DeviceLoop driven 3d frames
- of the object (pretty neat stuff!)
-
- 23-may-95 - ty - changes for compatibility with the CodeWarrior CW6
- release and the associated Universal Headers from Apple:
- most methods that returned references now have "Ref" at
- the end of their methods names to prevent possible collisions
- with datatypes and classes of the same name (older versions
- of the compiler didn't have a problem with this).
-
- */
-
- /*===========================================================================*/
-
- /*========== Exclusion Macros ============*/
-
- #pragma once
-
- #ifndef _ABObject_
- #define _ABObject_
-
-
- /*============ Header Files ==============*/
-
- #include "ABProperties.h"
- #include "ABUEnvQD.h"
-
-
- /*=========== External Linkage ===========*/
-
- /*================ Macros ================*/
-
- /*============== Constants ===============*/
-
- #define kABObjectRefCon 'OBrc'
- #define kABObjectRefConSize (sizeof(long))
-
- #define kABObjectVisible 'OBvi'
- #define kABObjectVisibleSize (sizeof(Boolean))
-
- #define kABObjectRect 'Orct'
- #define kABObjectRectSize (sizeof(Rect))
-
- // a set of colors used in drawing things,
- // such as the bezel, in a pseudo-three-dimensional fashion.
- // Suggestions for these colors came from _develop_ issue #15
- #define k3D_lineWhite ((unsigned short)(0xffff))
- #define k3D_lineLightGrey ((unsigned short)(0xeeee))
- #define k3D_lineMedLightGrey ((unsigned short)(0xaaaa))
- #define k3D_lineMedDarkGrey ((unsigned short)(0x8888))
- #define k3D_lineDarkGrey ((unsigned short)(0x5555))
- #define k3D_lineBlack ((unsigned short)(0x0000))
-
-
- /*================ Enums =================*/
-
- enum {
- kABMessageDraw = 300,
- kABMessageUpdate,
- kABMessageEvent,
- kABMessageStop,
- kABMessageCheckFile
- };
-
-
- /*=============== Structs ================*/
-
- /*=============== Typedefs ===============*/
-
- /*=========== Class Definitions ==========*/
-
- #define kABObjectSuperProperty ABProperties
- class ABObject : ABProperties, private ABUEnvQD
- {
- public:
- ABObject(void);
- virtual ~ABObject(void);
-
- virtual OSErr Draw(WindowPtr window);
- virtual OSErr Update(WindowPtr window);
- virtual Boolean Event(EventRecord *event);
- virtual OSErr Stop(void);
- virtual Boolean CheckFile(FSSpecPtr fssptr);
-
- virtual OSErr GetProperty (ABProperty prop, void *ptr, long *ptrSize);
- virtual OSErr SetProperty (ABProperty prop, void *ptr, long ptrSize);
-
- virtual OSErr Resize(Rect const *field);
-
- virtual OSErr InitializeObject(void);
-
- virtual OSErr ScaleRectToFit(Rect& item, const Rect& area, float factor);
-
- OSErr EraseFrame (void) const;
- OSErr DrawFrame (void) const;
-
- static Boolean CanDraw3dBezel(short inDepth);
- static Boolean CantDraw3dBezel(short inDepth) { return ! ABObject::CanDraw3dBezel(inDepth); }
-
- Boolean IsVisibleObject(void) const { return this->VisibleObject() == true; }
- Boolean IsVisible(void) const { return this->IsVisibleObject(); }
- Boolean IsInvisible(void) const { return !this->IsVisibleObject(); }
-
- Boolean HasWindow(void) const { return this->GetWindow() != NULL; }
- Boolean DoesntHaveWindow(void) const { return ! this->HasWindow(); }
-
- WindowPtr GetWindow(void) const { return this->OurWindowRef(); }
-
- Boolean IsThisTheWindow(GrafPtr inWindow) const { return inWindow == this->GetWindow(); }
- Boolean NotOurWindow(GrafPtr inWindow) const { return ! this->IsThisTheWindow(inWindow); }
-
- Boolean IsTheFrontWindow(void) const { return this->GetWindow() == ::FrontWindow(); }
- Boolean NotTheFrontWindow(void) const { return !this->IsTheFrontWindow(); }
-
- // this/these method(s) are used via ::DeviceLoop() to handle multiple device
- // drawing. Do not call them directly from your application!
-
- static pascal void DeviceLoopDrawFrame(short inDepth, short inDeviceFlags, GDHandle inDevice, long inUserData);
-
- protected:
- long mRefCon;
- Boolean mVisibleObject;
- Rect mObjectRect;
- WindowPtr mOurWindow;
-
- Rect& ObjectRect(void) const { return this->mObjectRect; }
- Boolean& VisibleObject(void) const { return this->mVisibleObject; }
- long& RefCon(void) const { return this->mRefCon; }
- WindowPtr& OurWindowRef(void) const { return this->mOurWindow; }
-
- static OSErr EraseFrame (Rect& rect);
- static OSErr DrawFrame (Rect& rect);
-
- private:
- };
-
-
-
-
- /*========== Function Prototypes =========*/
-
-
-
-
- #endif // _ABObject_
-
-